package cn.exercises.oop03;

public class Phone {
    private String brand;
    private int price;

    public static  int SIZE = 5;

    public Phone() {
    }

    public Phone(String brand, int price) {
        this.brand = brand;
        this.price = price;
    }

    /**
     * 获取
     * @return brand
     */
    public String getBrand() {
        return brand;
    }

    /**
     * 设置
     * @param brand
     */
    public void setBrand(String brand) {
        this.brand = brand;
    }

    /**
     * 获取
     * @return price
     */
    public int getPrice() {
        return price;
    }

    /**
     * 设置
     * @param price
     */
    public void setPrice(int price) {
        this.price = price;
    }

    public String toString() {
        return "Phone{brand = " + brand + ", price = " + price + "}";
    }

    // 行为:打电话call,发短信sendMessage,玩游戏playGame
    public void call(){
        System.out.printf("%d寸 %s手机,售价%d,正在打电话\n",SIZE, this.brand,this.price);
    }

    // 发短信sendMessage
    public void sendMessage(){
        System.out.printf("%d寸 %s手机,售价%d,正在发短信\n",SIZE,this.brand,this.price);
    }

    // 玩游戏playGame
    public void playGame(){
        System.out.printf("%d寸 %s手机,售价%d,正在玩游戏\n",SIZE,this.brand,this.price);
    }
}
